package com.btpn.infra.web.struts2.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.opensymphony.xwork2.ActionSupport;

@ParentPackage(value="default")
@Results({
	@Result(name="success", type="redirectAction", params = {"actionName", "home"} )
})
public class DefaultAction extends ActionSupport {

	private static final long serialVersionUID = -4364666665883229318L;
	
	public String execute() {
		return SUCCESS;
	}
	
	@Action(value = "/login", results = { @Result(name = "success", location = "login.jsp") })
	public String login() throws Exception {		
		return SUCCESS;
	}
	
	@Action(value = "/logout", results = { @Result(name = "success", location = "login.jsp") })
	public String logout() throws Exception {		
		return SUCCESS;
	}
}
